package com.internship.service;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.internship.dao.WeeknoteDao;
import com.internship.model.Weeknote;
import com.internship.page.Page;

@Service
public class WeeknoteService {
	private final int PAGE_SIZE = 10;
	@Autowired
	private WeeknoteDao weeknoteDao;

	public Weeknote getWeeknoteById(int Id) {
		return weeknoteDao.getWeeknoteById(Id);
	}
	public Page<Weeknote> getWeeknoteList(String DeptCode,String StudentName,String TeacherNumber,int pageNumber) {
		Page<Weeknote> page = new Page<Weeknote>(pageNumber, PAGE_SIZE);
		List<Weeknote> list = weeknoteDao.getWeeknoteList(DeptCode, StudentName, TeacherNumber, page);
		page.setResultList(list);
		return page;
	}
	public Page<Weeknote> getMyWeeknoteList(String JobStudentNumber,int pageNumber) {
		Page<Weeknote> page = new Page<Weeknote>(pageNumber, PAGE_SIZE);
		List<Weeknote> list = weeknoteDao.getMyWeeknoteList(JobStudentNumber, page);
		page.setResultList(list);
		return page;
	}
	public List<Weeknote> getWeeknoteReportList(String JobStudentNumber) {
		List<Weeknote> list = weeknoteDao.getWeeknoteReportList(JobStudentNumber);
		return list;
	}
	public List<Weeknote> getWeeknoteList() {
		List<Weeknote> list = weeknoteDao.getWeeknoteList();
		return list;
	}
	public int addWeeknote(Weeknote weeknote) {
		return weeknoteDao.addWeeknote(weeknote);
	}

	public int updateWeeknote(Weeknote weeknote) {
		return weeknoteDao.updateWeeknote(weeknote);
	}
	public int markingWeeknote(Weeknote weeknote) {
		return weeknoteDao.markingWeeknote(weeknote);
	}
	public int delWeeknote(int Id) {
		return weeknoteDao.delWeeknote(Id);
	}
	public int delAll(String[] ids) {
		return weeknoteDao.delAll(ids);
	}
	public int getWeeknotePractice(String DeptCode,int grade) {
		return weeknoteDao.getWeeknotePractice(DeptCode, grade);
	}
	public int getWeeknoteUncheckNotes(String DeptCode,int grade) {
		return weeknoteDao.getWeeknoteUncheckNotes(DeptCode, grade);
	}
	public int getWeeknoteCount(String DeptCode,int grade) {
		return weeknoteDao.getWeeknoteCount(DeptCode, grade);
	}
}
